home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 051-075 / scopedisk57 / pdmake / readenv.c < prev    next >
C/C++ Source or Header  |  1995-03-19  |  374b  |  22 lines

  1. /*
  2.  *    readenv() - set macro values from the environment
  3.  */
  4. #include <stdio.h>
  5.  
  6. readenv()
  7. {
  8.     extern long    _base;
  9.     char    *envp, *p, *strchr();
  10.     char    buf[256];
  11.  
  12.     envp = *((char **) (_base + 0x2c));
  13.  
  14.     for (; strncmp(envp, "ARGV=", 5) != 0 ; envp += strlen(envp) + 1) {
  15.         strcpy(buf, envp);
  16.         if ((p = strchr(buf, '=')) == NULL)
  17.             return;
  18.         *p++ = '\0';
  19.         setmacro(buf, p);
  20.     }
  21. }
  22.